package com.wk.springboot.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

@Component
public class KafkaConsumer {

    @KafkaListener(topics = "my_topic", groupId = "my_group")
    public void consume(  ConsumerRecord<String, Object> record) throws Exception {
        System.out.println("Message received: " + record.toString());
//        Thread.sleep(5000);
//        if (true){
//            throw new Exception("11111");
//        }
    }
}